// GM_download(details), GM_download(url, name)
// Downloads a given URL to the local disk.
//
//     details can have the following attributes:
//     url - the URL from where the data should be downloaded (required)
// name - the filename - for security reasons the file extension needs to be whitelisted at Tampermonkey's options page (required)
// headers - see GM_xmlhttpRequest for more details
// saveAs - boolean value, show a saveAs dialog
// onerror callback to be executed if this download ended up with an error
// onload callback to be executed if this download finished
// onprogress callback to be executed if this download made some progress
// ontimeout callback to be executed if this download failed due to a timeout
// The download argument of the onerror callback can have the following attributes:
//     error - error reason
// not_enabled - the download feature isn't enabled by the user
// not_whitelisted - the requested file extension is not whitelisted
// not_permitted - the user enabled the download feature, but did not give the downloads permission
// not_supported - the download feature isn't supported by the browser/version
// not_succeeded - the download wasn't started or failed, the details attribute may provide more information
// details - detail about that error
// Returns an object with the following property:
//     abort - function to be called to cancel this download
//
// Depending on the download mode GM_info provides a property called downloadMode which is set to one of the following values: native, disabled or browser.